
#ifndef __LIBERTY_LIBRARY_IASSETDEPOT_H__
#define __LIBERTY_LIBRARY_IASSETDEPOT_H__

#include <Liberty3D/Engine/IMutableAssetFile.h>
#include <list>

namespace Liberty { namespace Library {
    /**
     * This is the main interface of the Library module. It gives access to every files
     * contained inside a project. It keeps tracks of what was modified, what's need to be
     * reprocessed, keeps a cache of AssetImporter, AssetCachedData and AssetBuildData objects.
     */
    class IAssetDepot : public Liberty::Engine::IMutableAssetFile {
    public:
        /** Force a depot to check for external changes. (ie. check the local filesystem.) */
        virtual void detectChanges() = 0;

        /** Add a depot listener. */
        virtual void addListener(const std::shared_ptr<IAssetDepotListener>&) = 0;

        /** Remove a depot listener. */
        virtual void removeListener(const std::shared_ptr<IAssetDepotListener>&) = 0;

        /** Determine the path for a particular uuid. */
        virtual std::string pathForUuid(const Liberty::Engine::Uuid& uuid) const = 0;

        /** Determine the UUID for a particular path. */
        virtual Liberty::Engine::Uuid uuidForPath(const std::string& fileName) const = 0;

        /** Retreive an importer for an asset. */
        virtual std::shared_ptr<AssetImporter> importer(const Liberty::Engine::Uuid&) = 0;

        /** Retreive the cached data about an asset. */
        virtual std::shared_ptr<AssetCachedData> cachedData(const Liberty::Engine::Uuid&) = 0;

        /** Retreive the build data about an asset. */
        virtual std::shared_ptr<AssetBuildData> buildData(const Liberty::Engine::Uuid&, const std::string& buildTag) = 0;

        /** Retreive the available build datas about an asset. */
        virtual std::list<std::string> buildDatas(const Liberty::Engine::Uuid&) = 0;

        /** Force an asset to be reimported. */
        virtual void reimport(const Liberty::Engine::Uuid&) = 0;

    public:
        /** Create a depot based on a local filesystem. */
        static std::shared_ptr<IAssetDepot> assetDepotForFolder(const std::string& folder, bool create);
    };
}}

#endif
